﻿using Microsoft.EntityFrameworkCore.Migrations;

namespace _220105BookSys.Model.Migrations
{
    public partial class secondInitializeDatabase : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.RenameColumn(
                name: "varchar",
                table: "BookTypes",
                newName: "Name");

            migrationBuilder.RenameColumn(
                name: "varchar(20)",
                table: "Books",
                newName: "Name");

            migrationBuilder.RenameColumn(
                name: "varchar(200)",
                table: "Books",
                newName: "Describe");

            migrationBuilder.AlterColumn<string>(
                name: "Name",
                table: "BookTypes",
                type: "varchar(20)",
                maxLength: 20,
                nullable: false,
                oldClrType: typeof(string),
                oldType: "nvarchar(20)",
                oldMaxLength: 20);

            migrationBuilder.AlterColumn<string>(
                name: "Name",
                table: "Books",
                type: "varchar(20)",
                maxLength: 20,
                nullable: false,
                oldClrType: typeof(string),
                oldType: "nvarchar(20)",
                oldMaxLength: 20);

            migrationBuilder.AlterColumn<string>(
                name: "Describe",
                table: "Books",
                type: "varchar(200)",
                maxLength: 200,
                nullable: false,
                oldClrType: typeof(string),
                oldType: "nvarchar(200)",
                oldMaxLength: 200);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.RenameColumn(
                name: "Name",
                table: "BookTypes",
                newName: "varchar");

            migrationBuilder.RenameColumn(
                name: "Name",
                table: "Books",
                newName: "varchar(20)");

            migrationBuilder.RenameColumn(
                name: "Describe",
                table: "Books",
                newName: "varchar(200)");

            migrationBuilder.AlterColumn<string>(
                name: "varchar",
                table: "BookTypes",
                type: "nvarchar(20)",
                maxLength: 20,
                nullable: false,
                oldClrType: typeof(string),
                oldType: "varchar(20)",
                oldMaxLength: 20);

            migrationBuilder.AlterColumn<string>(
                name: "varchar(20)",
                table: "Books",
                type: "nvarchar(20)",
                maxLength: 20,
                nullable: false,
                oldClrType: typeof(string),
                oldType: "varchar(20)",
                oldMaxLength: 20);

            migrationBuilder.AlterColumn<string>(
                name: "varchar(200)",
                table: "Books",
                type: "nvarchar(200)",
                maxLength: 200,
                nullable: false,
                oldClrType: typeof(string),
                oldType: "varchar(200)",
                oldMaxLength: 200);
        }
    }
}
